#pragma once
#include "core/NamedObject.h"
class BaseSubsystem;
class ISubsystem;


enum ProcessorResultEnum
{	
	continueloopProcessorResult,
	endloopProcessorResult,
	skipNextStepsAndContinueloopProcessorResult,
	skipNextStepsAndEndloopProcessorResult,
};

////////////////////////////////////////////////////////////////////////
//interface
class IProcessor: public NamedObject
{

public:	
	inline virtual ~IProcessor() {};

	//prepara per il loop
	virtual void startup(void)=0;
	
	//fine loop
	virtual void shutdown(void)=0;

	//passo del loop
	virtual ProcessorResultEnum runStep(long delta) = 0;

};

////////////////////////////////////////////////////////////////////////

class BaseProcessor : public IProcessor, boost::noncopyable 
{
protected:
	BaseProcessor()
	{
	}

	virtual ~BaseProcessor()
	{}

public:
	virtual inline void init()
	{		
	};

	//prepara per il loop
	virtual inline void startup(void)
	{
	}
	
	//fine loop
	virtual inline void shutdown(void)
	{
	}

	//passo del loop
	virtual inline ProcessorResultEnum runStep(long delta) 
	{
		return ProcessorResultEnum::continueloopProcessorResult;
	}

};

////////////////////////////////////////////////////////////////
